my_dict = {2: 20, 1: 10, 3: 30, 5: 50, 4: 40}

# 将字典的键值按从大到小排序，并获取排序后的键名和键值
sorted_keys = sorted(my_dict, reverse=True)
sorted_values = [my_dict[key] for key in sorted_keys]

# 将排序后的键名和键值分别保存到两个列表中
keys_list = list(sorted_keys)
values_list = list(sorted_values)

# 打印结果
print("Keys:", keys_list)
print("Values:", values_list)
